//
//  AddProductFooterView.m
//  LazyCat
//
//  Created by Abner on 16/9/23.
//  Copyright © 2016年 zhanshu. All rights reserved.
//

#import "AddProductFooterView.h"

@implementation AddProductFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatAddFooterView];
    }
    return self;
}
-(void)creatAddFooterView
{
    self.plusImgV = [[UIImageView alloc]init];
    [self addSubview:self.plusImgV];
    self.plusImgV.image = [UIImage imageNamed:@"add_icon"];
    self.plusImgV.contentMode = UIViewContentModeScaleToFill;
    
    self.recommenderLB = [[UILabel alloc]init];
    [self addSubview:self.recommenderLB];
    self.recommenderLB.font = FontSet(15);
    self.recommenderLB.textColor = SetColorRGBValue(0xff6600, 1.0);
    
    self.topMaskBT = [UIButton buttonWithType:UIButtonTypeCustom];
    [self addSubview:self.topMaskBT];
    self.topMaskBT.frame = CGRectMake(0, 0, 130, self.height);
    [self.topMaskBT addTarget:self action:@selector(topMaskBtClicked) forControlEvents:UIControlEventTouchUpInside];
    
}
-(void)setupAddProductFooterViewData:(NSString *)lbText isEmptyArr:(BOOL)isEmptyArr
{
    self.recommenderLB.text = lbText;
    if (isEmptyArr) {
        self.plusImgV.frame = CGRectMake(10, 0, 18, 18);
        self.recommenderLB.frame = CGRectMake(self.plusImgV.right+3, -1, 150, 20);
    }else{
        self.plusImgV.frame = CGRectMake(10, 16, 18, 18);
        self.recommenderLB.frame = CGRectMake(self.plusImgV.right+3, 15, 150, 20);
    }
}
-(void)topMaskBtClicked
{
    if (self.footerViewAddBlock) {
        self.footerViewAddBlock();
    }
}

@end
